$(document).ready(function(){            
	$("#holidayinfo").jqGrid({                
		url:global_url+global_urijs+'schoolhol_search'+global_suffix+"?sid="+global_sid,                
		datatype:"json",                
		mtype:'GET',
		height:'300',
		width:'770',                
		colNames:['假期名称','假期起始时间','假期结束时间','假期天数','假期编号'],                
		colModel:[
		{name:'desinfo',index:'desinfo',width:60,align:'center'},                    
		{name:'sdate_str',index:'sdate_str',width:150,align:'center'},                    
		{name:'edate_str',index:'edate_str',width:150,align:'center'}, 
		{name:'hdays',index:'hdays',width:60,align:'center'},                    
		{name:'hid',index:'hid',hidden:true},
		],
		//autowidth:true,
		jsonReader: {
			root:"scHolidays",
			page: "page",
			total: "page_count",
			records : "count",
			repeatitems: false
		},
		pager: jQuery("#holidaypage"),
		prmNames : {page:"page",sort: "sort"},
		rowNum: 10,
		//rowList: [10, 20, 30],
		sortname: 'sdate_str',
		hidegrid: false,
		sortorder: 'asc',
		viewrecords: true,
		caption: '假期信息',
		gridComplete:function(){
			var ids=jQuery("#holidayinfo").jqGrid('getDataIDs');

			for(var i=0; i<ids.length; i++){
				var id=ids[i];   
				days = "<span>"+daysBetween(jQuery('#holidayinfo').jqGrid('getRowData', id).sdate_str, jQuery("#holidayinfo").jqGrid('getRowData', id).edate_str)+"</span>";
				jQuery("#holidayinfo").jqGrid('setRowData', ids[i], { hdays:days});
			}
		}
	}).navGrid("#holidaypage", { edit: false, add: false, del: false, search: false });
});
